package com.iretailer.report.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iretailer.report.util.TimeUtil;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @Auther xjw
 * @Date 2019/1/21 0958
 * @Description
 */
@TableName(value = "t_sales")
public class Sales {

    public Sales() {
    }


    @JSONField(name = "Id")
    @TableId(value = "Id", type = IdType.ID_WORKER_STR)
    private String id;

    @JSONField(name = "Date")
    @TableField(value = "Date")
    private LocalDate date;

    @JSONField(name = "Time")
    @TableField(value = "Time")
    private LocalDateTime time;

    @JSONField(name = "Sales")
    @TableField(value = "Sales")
    private Double sales;

    //交易笔数
    @JSONField(name = "Receipts")
    @TableField(value = "Receipts")
    private Integer receipts;

    //交易件数
    @JSONField(name = "Pieces")
    @TableField(value = "Pieces")
    private Integer pieces;


    @JSONField(name = "MallId")
    @TableField(value = "MallId")
    private String mallId;


    public String getMallId_Date() {
        if (null != this.date) {
            return mallId + "_" + TimeUtil.localDate_format(this.date);
        }
        return mallId + "_";
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }

    public Double getSales() {
        return sales;
    }

    public void setSales(Double sales) {
        this.sales = sales;
    }

    public Integer getReceipts() {
        return receipts;
    }

    public void setReceipts(Integer receipts) {
        this.receipts = receipts;
    }

    public Integer getPieces() {
        return pieces;
    }

    public void setPieces(Integer pieces) {
        this.pieces = pieces;
    }


    public String getMallId() {
        return mallId;
    }

    public void setMallId(String mallId) {
        this.mallId = mallId;
    }


}
